Skip to content

Conversation

@domdomegg
Copy link
Member

The MCP spec does not require outputSchema to have type: 'object' at the root level - it can be any valid JSON Schema. This allows tools to return arrays, primitives, or other structures for list/batch responses.

inputSchema still correctly requires type: 'object' since tool inputs are always named parameters.

Fixes #1149

@domdomegg domdomegg requested a review from a team as a code owner November 25, 2025 19:29
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 25, 2025

Open in StackBlitz

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/sdk@1169

commit: b567184

The MCP spec does not require outputSchema to have type: 'object' at the
root level - it can be any valid JSON Schema. This allows tools to return
arrays, primitives, or other structures for list/batch responses.

inputSchema still correctly requires type: 'object' since tool inputs are
always named parameters.

Fixes #1149
@domdomegg domdomegg force-pushed the adamj/fix-output-schema-restriction branch from 3e41a67 to b567184 Compare November 25, 2025 19:32
@bhosmer-ant
Copy link
Contributor

MCP spec does require outputSchema to have type: 'object' at the root level - see https://modelcontextprotocol.io/specification/draft/schema#tool. Relaxing this restriction has been proposed, but it remains in the present spec unless I've missed a late-breaking development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

output schema has unnecessary restriction type=object

3 participants